{% extends "master.html" %}
{% block subtitle %} - 系统设置 - 创建组别{% endblock %}

{% block extJS %}
<script language="JavaScript" type="text/javascript">
//<![CDATA[
    function save(){
        $("form").submit();
    }
    
    function toCancel(){
         redirect_alert("{{MSG_LEAVE_WITHOUT_SAVING}}","{{url_for('bpSys.view',action='obj_index',t='GRP')}}");
    }
    
//]]>
</script>
{% endblock %}

{% block main %}
<div class="container">
    <div class="row">
        <ol class="breadcrumb">
          <li><a href="{{url_for('bpSys.view')}}">系统设置</a></li>
          <li><a href="{{url_for('bpSys.view',action='obj_index',t='GRP')}}">组别管理</a></li>
          <li class="active">创建组别</li>
        </ol>
    </div>
    <div class="row">
        <div class="btn-toolbar pull-right">
            <div class="btn-group"><button class="btn btn-primary" onclick="save()">{{BTN_SUBMIT}}</button></div>
            <div class="btn-group"><button class="btn btn-inverse" onclick="toCancel()">{{BTN_CANCEL}}</button></div>
        </div>
    </div>

    <div class="row">
        <form class="form-horizontal" method='POST' action="{{url_for('.view',action='obj_save')}}">
            <input type="hidden" name="t" value="{{t}}"/>
            <div class="control-group">
                <label class="control-label" for="name">组别名称<span style='color:red'>*</span></label>
                <div class="controls">
                  <input type="text" id="name" name="name" placeholder="组别名称">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="displayName">显示名称<span style='color:red'>*</span></label>
                <div class="controls">
                  <input type="text" id="displayName" name="displayName" placeholder="显示名称">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="desc">备注</label>
                <div class="controls">
                  <textarea name="desc" id="desc" placeholder="备注"></textarea>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="desc">拥有权限</label>
                <div class="controls">
                  {% for p in permissions %}
                    <label class="checkbox-inline">
                      <input type="checkbox" value="{{p}}" name="permissions">&nbsp;{{permissions[p]}}
                    </label>
                  {% endfor %}
                </div>
            </div>
        </form>
    </div>
</div>
{% endblock %}